﻿using Isaac.Joy.Ormapping.Contract;
using UIShell.OSGi;

namespace Isaac.Joy.Cms.Repository.SqlClient
{
    class Database
    {
        private static IDatabase _instence;
        public static IDatabase Instence
        {
            get
            {
                if (_instence != null) return _instence;

                var factory = BundleRuntime.Instance.GetFirstOrDefaultService<IDatabaseProviderFactory>();
                _instence = factory.CreateDefault();
                return _instence;
            }
        }
    }
}
